﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="UserRound.aspx.cs" Inherits="ProjectSem40701.Admin.UserRound" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="server">
    <title>Vòng thi</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    
    <li><a href="#" class="report">Thêm kỳ thi mới</a></li>
    <li><a href="UserRound.aspx">Chọn thí sinh vào vòng sau</a></li>
    
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!--
        set tab active here
     -->
    <script type="text/javascript" language="javascript">
        setTab(document.getElementById("7"));
    </script>
    <!--
        end set tab active
     -->
     <div id="box">
        <telerik:radscriptmanager ID="RadScriptManager1" runat="server">
        </telerik:radscriptmanager>      
        <h3>Chọn lọc thành viên vào vòng sau</h3>
        <fieldset class="fieldset">
            <legend>
                Chọn vòng thi
            </legend>
            
            <p>
                <label>Kỳ thi</label>
                <asp:DropDownList ID="cbbExam" runat="server" AutoPostBack="True" 
                    DataSourceID="ObjectDataSource3" DataTextField="ExamName" 
                    DataValueField="ExamID" ondatabound="cbbExam_DataBound" 
                    onselectedindexchanged="cbbExam_SelectedIndexChanged" Width="150px">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource3" runat="server" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="Get_tbl_Exam_Select_All" 
                    TypeName="ProjectSem40701.Admin.AdminXSD.ExamTableAdapters.tbl_ExamTableAdapter">
                </asp:ObjectDataSource>
            </p>
            
            <p>
                <label>Vòng trước</label>
                <asp:DropDownList ID="cbbPrevRound" runat="server" Width="150px" 
                    DataSourceID="ObjectDataSource1" DataTextField="RoundName" 
                    DataValueField="RoundID" AutoPostBack="True" 
                    onselectedindexchanged="cbbPrevRound_SelectedIndexChanged" 
                    ondatabound="cbbPrevRound_DataBound">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                    OldValuesParameterFormatString="original_{0}" 
                    SelectMethod="Get_tbl_Round_Select_All_By_ExamID" 
                    
                    TypeName="ProjectSem40701.Admin.AdminXSD.RoundTableAdapters.tbl_RoundTableAdapter">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="cbbExam" Name="exid" 
                            PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </p>
            <p>
                <label>Vòng sau</label>
                <asp:DropDownList ID="cbbNextRound" runat="server" Width="150px" 
                    DataSourceID="ObjectDataSource1" DataTextField="RoundName" 
                    DataValueField="RoundID" AutoPostBack="True" 
                    ondatabound="cbbNextRound_DataBound">
                </asp:DropDownList>
                <asp:Label ID="lblMinMark" runat="server" Visible="False"></asp:Label>
            </p>
            
        </fieldset>
    </div>
    
    <div id="box">
        <asp:GridView ID="grvUser" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource2" 
            AllowPaging="True" AllowSorting="True" 
            onpageindexchanging="grvUser_PageIndexChanging">
            <Columns>
                <asp:TemplateField HeaderText="Mã thí sinh" SortExpression="UserId" 
                    Visible="False">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("UserId") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lblUserID" runat="server" Text='<%# Bind("UserId") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Họ tên" SortExpression="UserLastName">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("UserLastName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("UserLastName") %>'></asp:Label>
                        &nbsp;<asp:Label ID="Label2" runat="server" Text='<%# Eval("UserFirstName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="UserName" HeaderText="UserName" 
                    SortExpression="UserName" />
                <asp:BoundField DataField="Mark" HeaderText="Điểm" SortExpression="Mark" />
                <asp:TemplateField HeaderText="Thời điểm hoàn thành" 
                    SortExpression="TimeComplete">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("TimeComplete") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" 
                            Text='<%# Bind("TimeComplete", "{0:dd/MM/yyyy hh:mm:ss tt}") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="200px" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkbSelect" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                Khong co du lieu
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" 
            OldValuesParameterFormatString="original_{0}" 
            SelectMethod="Get_tbl_User_Round_Result_By_RoundID_RoundMinMark" 
            
            
            TypeName="ProjectSem40701.Admin.AdminXSD.UserRound2TableAdapters.tbl_User_Round_Result_By_RoundID_RoundMinMarkTableAdapter">
            <SelectParameters>
                <asp:ControlParameter ControlID="lblMinMark" Name="RoundMinMark" 
                    PropertyName="Text" Type="Double" />
                <asp:ControlParameter ControlID="cbbPrevRound" Name="rid" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
    <div align="center">
        <asp:Button ID="btnAddRound" runat="server" Text="Thêm mới " CssClass="button" 
            onclick="btnAddRound_Click" />
        
        <cc1:ModalPopupExtender ID="btnAddRound_ModalPopupExtender" runat="server" 
            DynamicServicePath="" Enabled="false" 
            TargetControlID="btnAddRound" 
            PopupControlID="pnlPopup" 
            BackgroundCssClass="modalBackground">
        </cc1:ModalPopupExtender>
       
        <cc1:ConfirmButtonExtender ID="ConfirmButtonExtender2" runat="server" 
            ConfirmText="Bạn có thực sự muốn thêm mới vòng thi?" Enabled="True" TargetControlID="btnAddRound">
        </cc1:ConfirmButtonExtender>
        
        <asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog" style="display:none;">
            <div class="inner">
                <h2>
                    <asp:Literal ID="ltrMessage" runat="server"></asp:Literal>
                </h2>
                <div class="base">
                    <asp:Button ID="btnYes" onclick="btnYes_Click" runat="server" Text="Yes" />
                    <asp:Label ID="lblSuccess" runat="server" Text="" Visible="False"></asp:Label>
                    <asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" 
                        OnClientClick="$find('mdlPopup').hide(); return false;" />
                </div>
            </div>
        </asp:Panel>
        
    </div>
</asp:Content>